define(['jquery', 'bootstrap', 'frontend', 'form', 'template'], function ($, undefined, Frontend, Form, Template) {

    var Controller = {
        detail: function () {
            Controller.api.bindevent();
            //绑定tab选中事件
            $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
                //var activeTab = $(e.target).text();
                //alert(activeTab);
                //var previousTab = $(e.relatedTarget).text();
                //alert(previousTab);

                //根据选中项href值获取页名
                var panel = $($(e.target).attr("href"));
                //如果页名存在
                if (panel.size() > 0 ) {
                    if( panel.attr("id")=="reviews") apprfilter('all');
                    else if( panel.attr("id")=="reviews") consultfilter(this,'0');
                }
                //移除绑定的事件
                $(this).unbind('shown.bs.tab');

            });
            //必须默认触发shown.bs.tab事件
            $('ul.nav-tabs li.active a[data-toggle="tab"]').trigger("shown.bs.tab");
        },
        api: {
            bindevent: function () {
                Form.api.bindevent($("form[role=form]"));
            }
        }
    };
    return Controller;

});